package com.zjht.gmcc.servlet.sys;

/* 
 * @author 朱家进
 * @version 1.4
 * ���ܣ��û�����
 * 2007-04-28
 */
import java.io.PrintWriter;
import java.sql.PreparedStatement;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zjht.gmcc.bean.BaseServlet;
import com.zjht.gmcc.bean.util.MyJDBC;
import com.zjht.gmcc.bean.util.MySession;

public class HallTime extends BaseServlet {

	private static final long serialVersionUID = 1L;


	public boolean process(HttpServletRequest request, HttpServletResponse response,HttpSession session, PrintWriter out, MyJDBC myJDBC,  String menu)throws Exception {

		int i_flag = 0;

		// ===============
		String s_orgacode = MySession.getOrgcode(session);

		String sdateH = request.getParameter("sdateH");
		String sdateM = request.getParameter("sdateM");
		String edateH = request.getParameter("edateH");
		String edateM = request.getParameter("edateM");

		String s_sql = null;
		PreparedStatement ps = null;

		s_sql = "update organiza set sdate = ?, edate= ? where orgacode = ?";
		ps = myJDBC.prepareStatement(s_sql);

		ps.setString(1, sdateH + ":" + sdateM);
		ps.setString(2, edateH + ":" + edateM);
		ps.setString(3, s_orgacode);
		i_flag = ps.executeUpdate();

		s_sql = null;
		ps.close();
		ps = null;

		String act = "服务厅营业时间设置";
		if (i_flag > 0) {
			alertAndReturnValue(out,act + "成功", "2");
		} else {
			errAlert(request, out, menu, act + "失败");
		}
		return i_flag > 0;

	}
}
